﻿using Connection.IView;
using Connection.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Connection.Presenter
{
    [Serializable()]
    public class LoginPresenter : MarshalByRefObject
    {
        public bool IsLoginOk(string username, string password)
        {
            UserModel _userModel = new UserModel(username, password);
            if (_userModel.IsRightUsernamePassword())
                return true;
            else return false;
        }

        public void UpdateIsOnline(string username, int isonline)
        {
            UserDB _userDB = new UserDB();
            string userid = _userDB.SelectUserId(username);
            _userDB.UpdateIsOnline(userid, isonline);
        }

        public int Test() { return 0; }
    }
}
